package com.ddtech.framework.system.repository;

import com.ddtech.framework.system.model.SysMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.LinkedHashSet;
import java.util.List;

/**
 * @author Apache License
 * @date 2018-12-17
 */
public interface MenuRepository extends JpaRepository<SysMenu, String>, JpaSpecificationExecutor {

    /**
     * findByName
     * @param name
     * @return
     */
    SysMenu findByName(String name);

    /**
     * findByPid
     * @param pid
     * @return
     */
    List<SysMenu> findByPid(String pid);

    LinkedHashSet<SysMenu> findByRoles_IdOrderBySortAsc(String id);
}
